package com.ymatou.iapi.coupon.service;

import com.ymatou.iapi.coupon.parameter.GetPagingUserCouponListReturnData;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.EnvSetup;

/**
 * 获取买家优惠券列表接口Call FreeMaker Template自动生成代码
 */
public class GetPagingUserCouponListCall extends YmatouBaseCall {
	private static String opurl = "api/Promotion/GetPagingUserCouponList";

	public GetPagingUserCouponListCall() {
		super(EnvSetup.getSystemUrl("couponiapi"), opurl, "POST", "JSON");
	}

	@Override
	public void addDefHeader() {
		client.addHeader("Accept", "text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}

	public String getStatusCode1() {
		return getString("statusCode");
	}

	public String getMessage() {
		return getString("message");
	}

	public String getData() {
		return getString("data");
	}

	public GetPagingUserCouponListReturnData getPagingUserCouponListReturnData() {
		GetPagingUserCouponListReturnData data = null;
		try {
			data = (GetPagingUserCouponListReturnData) FormatUtil.GSONToObject(DataUtil.Json.parseJsonObj(getData()).toString(),
					GetPagingUserCouponListReturnData.class);

		} catch (Exception e) {
			e.printStackTrace();
		}
		return data;
	}
}